{% load staticfiles %}
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <link rel="shortcut icon" type="" href="{% static 'images/python_512px_1118083_easyicon.net.png' %}">

    <link rel="stylesheet" href="{% static 'css/semantic.css' %}" media="screen" title="no title">
    <link rel="stylesheet" href="{% static 'css/common.css' %}" media="screen" title="no title">
    <link rel="stylesheet" href="{% static 'css/profile.css' %}" media="screen" title="no title">
    <link rel="shortcut icon" type="" href="{% static 'images/python_512px_1118083_easyicon.net.png' %}">
    <title>{{ user.name }} - 知乎</title>

</head>

<body>

    <div class="top nav">
        <div class="ui fixed borderless menu">
            <div class="logo item">
                <a href="{% url 'home' %}">
                    <img src="{% static 'images/logo.png' %}" alt="" class="ui image" />
                </a>
            </div>
            <div class="item">
                <div class="ui icon input">
                    <input class="prompt" placeholder="搜索您感兴趣的内容..." type="text">
                    <i class="search icon"></i>
                </div>
            </div>
            <a class="item">
                <img src="{% static 'images/question_icon.png' %}" alt="" class="ui image" />
                <span class="nav text">提问</span>
            </a>
            <a class="item">
                <img src="{% static 'images/answer_icon.png' %}" alt="" class="ui image" />
                <span class="nav text">回答</span>
            </a>
            <div class="right menu">
                <a class="item">
                <img style="width: 25px; height: 25px;" src="/static/uploads/{{ request.user.profile.avatar }}" alt="" class="ui image" />
                <span class="nav text"> {{ request.user.profile.name }}</span>
                </a>
                <a class="item" href="{% url 'logout' %}">
                    <span class="nav text"> 登出</span>
                </a>
            </div>
        </div>
    </div>
    <div class="ui vertical segment">
        <div class="ui container user segment">
            <a href="#">
                <div class="ui image">
                    <img src="/static/uploads/{{ user.avatar }}" alt="" style="width:100px;height: 100px;"/>
                </div>
                <p class="user change">
                    修改头像
                </p>
            </a>
            <h3 class="ui header">{{ user.name }}</h3>
            <a href="#">
                {% if user.desc %}
                <p class="subtitle">{{ user.desc }}</p>
                {% endif %}
                <span class="ex change">修改</span>
            </a>
        </div>
        <div class="ui container segment">
            <div class="hd-head">
                <div class="hd-title">
                    <h4 class="hd-name">回答</h4>
                    <span class="hd-num"> {{ answers | length }}</span>
                </div>
            </div>
            {% for answer in answers %}
            <div class="hd-list">
                
                <div class="hd-item">
                    <div class="hd-vote-num">
                        {{ answer.like_counts }}
                    </div>
                    <div class="hd-vote-type">
                        赞同
                    </div>
                </div>
                <div class="hd-main">
                    <h4 class="hd-question">
                        <a href="#" class="question_link">
                            {{ answer.question }}
                        </a>
                    </h4>
                    <p class="hd-item-text">
                            {% autoescape off %}
                            {{ answer.content | truncatechars:80 }}
                            {% endautoescape %}

                        
                    </p>
                </div>
                
            </div>
            {% endfor %}
        </div>
        <div class="ui container segment">

            <div class="hd-head">
                <div class="hd-title">
                    <h4 class="hd-name">提问</h4>
                    <span class="hd-num"> {{ questions | length }}</span>
                </div>
            </div>

            {% for question in questions %}
            <div class="hd-list">
                <div class="hd-question-item">

                </div>
                <div class="hd-main">
                    <h4 class="hd-question">
                        <a href="#" class="question_link">
                            {{ question.title }}
                        </a>
                    </h4>
                    <p class="hd-item-text">
                        {% autoescape off %}
                        {{ question.desc | truncatechars:80 }}
                        {% endautoescape %}
                    </p>
                </div>
            </div>
            {% endfor %}
        </div>
        
    </div>


<div class="ui vertical center aligned segment">
    <span class="ft-l">
        <a>Developed by 姚航</a>
    </span>
    <span class="ft-m">
        <a>关于我们.加入我们.联系我们</a>
    </span>
    <span class="ft-r">
        <a >京ICP备XXXXXXX号-2</a>
    </span>
</div>


</body>

</html>